<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=bu, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <button class="btn">按钮</button>
    <input type="text" value="输入内容" />

    <script>
      let btn = document.querySelector(".btn");
      let input = document.querySelector("input");

      btn.addEventListener("click", function () {
        input.value = "我被点击了"; ////文字内容通过value来修改
        this.disabled = true; //disable 修改元素属性禁用和启用
      });
    </script>
  </body>
</html>
